<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div>
      <h1>Flow特殊类型</h1>
    </div>
    <script>
      //只能是指定值
      const a: "foo" = "foo";
      //在指定值中可选
      const b: "success" | "warning" | "danger" = "success";
      //可选类型
      const c: string | number = 100; //'100'
      //可以yongtype  起别名
      type StringOrNumber = string | number;
      const d: StringOrNumber = "string"; //100

      // ===flow中的maybe类型
      const gender: ?number = null;
      const gender: ?number = undefined;
      //这个等于上面两种
      const gender: number | void | undefined = null;
    </script>
  </body>
</html>
